﻿@model PageDataVM<List<TeacherWithCourse>>
@{
    ViewData["Title"] = "选择课程";
}
@section Css{
<link rel="stylesheet" href="~/css/assessment.css" asp-append-version="true">
}
<div class="content" style="overflow-y:auto;">
    <h2>选择授课：</h2>

    <div class="content-table">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th scope="col">#</th>
                <th scope="col">授课编号</th>
                <th scope="col">课程名</th>
                <th scope="col">教师</th>
                <th scope="col">操作</th>
            </tr>
            </thead>
            <tbody>
            @{
                var index = 1;
                foreach (var item in Model.Data)
                {
                    <tr>
                        <td scope="row">@index</td>
                        <td>@item.TcId</td>
                        <td>@item.Course!.Name</td>
                        <td>@item.Teacher!.Name</td>
                        <td>
                            <a class="btn btn-outline-primary btn-sm" asp-action="Select" asp-controller="Student" asp-route-tcid="@item.TcId">选择</a>
                        </td>
                    </tr>
                    index++;
                }
            }
            </tbody>
        </table>
        @await Html.PartialAsync("Pagniation")
        @{
            if (Model.Data.Count < 1)
            {
                @Html.Raw( "<label class='text-tip'>没有可选学生</label>")
            }
        }
        <div style="width: 100%; height: 10px;"></div>
    </div>
</div>

@section Scripts{
<script src="~/js/select.js" asp-append-version="true"></script>
}
